package com.tax.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tax.entity.TdReportRecord;
import com.tax.mapper.TdReportRecordMapper;
import com.tax.service.ITdReportRecordService;
import org.junit.platform.commons.util.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class TdReportRecordServiceImpl extends ServiceImpl<TdReportRecordMapper, TdReportRecord> implements ITdReportRecordService {

    @Autowired
    private TdReportRecordMapper baseMapper;

    @Override
    public void insertReportEntity(TdReportRecord entity) {
        baseMapper.insert(entity);
    }

    @Override
    public void doReport(TdReportRecord entity) {
        baseMapper.insert(entity);
    }

    @Override
    public List<TdReportRecord> getReportList(TdReportRecord entity) {
        Map<String,Object> params = new HashMap<>();
        params.put("userId",entity.getUserId());
        if (null != entity.getState()) {
            params.put("state",entity.getState());
        }
        return baseMapper.selectListByUnifiedCode(params);
    }

}
